package com.itheima.string;

import java.util.Scanner;

public class StringMethod06 {
    /*
    字符串的替换,使用replace()方法
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入:");
        String s = sc.next();
        String s1 = s;

        String[] arr = {"TMD","tmd","SB","sb"};
        for(int i = 0;i < arr.length;i++) {
            s1 = s1.replace(arr[i], "***");
        }
        System.out.println(s1);
        System.out.println(s);
       /*
        String s1 = s.replace("TMD","***");
        String s2 = s1.replace("SB","**");
        System.out.println(s2);
        */
    }
}
